import request from '@/utils/request.js'

const prefix = "/api/personal"

//获取名片信息
export function getInfo(userId,openId) {
	return request({
		url: prefix + `/info/${userId}/${openId}`,
		method: 'get',
	})
}

//获取名片信息
export function cardInfo(userId) {
	return request({
		url: prefix + `/cardInfo/${userId}`,
		method: 'get',
	})
}




//新增名片信息
export function addInfo(data) {
	return request({
		url: prefix + `/add`,
		method: 'post',
		data: data
	})
}
//修改名片信息
export function editInfo(data) {
	return request({
		url: prefix + `/edit`,
		method: 'put',
		data: data
	})
}

//修改名片信息
export function editDescBus(data) {
	return request({
		url: prefix + `/editDesc`,
		method: 'put',
		data: data
	})
}

/**
 * 过往经历
 * @param {Object} params
 */
export function experienceList(userId) {
	return request({
		url: prefix + `/experience/${userId}`,
		method: 'get',
	})
}

/**
 * 新增工作经历
 * @param {Object} data
 */
export function addWork(data) {
	return request({
		url: prefix + `/addWork`,
		method: 'post',
		data: data
	})
}

//修改工作经历
export function editWork(data) {
	return request({
		url: prefix + `/editWork`,
		method: 'put',
		data: data
	})
}
//工作经历详请
export function getWorkInfo(id) {
	return request({
		url: prefix + `/workInfo/${id}`,
		method: 'get',
	})
}
/**
 * @param id删除工作经历
 */
export function deleteWork(id){
	return request({
		url: prefix + `/deleteWork/${id}`,
		method: 'delete',
	})
}
/**
 * 新增教育经历
 * @param {Object} data
 */
export function addEducational(data) {
	return request({
		url: prefix + `/addEducational`,
		method: 'post',
		data: data
	})
}

//修改教育经历
export function editEducational(data) {
	return request({
		url: prefix + `/editEducational`,
		method: 'PUT',
		data: data
	})
}
//教育经历详请
export function getEducationalInfo(id) {
	return request({
		url: prefix + `/educationalInfo/${id}`,
		method: 'get',
	})
}
/**
 * @param {Object} id删除教育经历 */
export function deleteEducational(id){
	return request({
		url: prefix + `/deleteEducational/${id}`,
		method: 'delete',
	})
}
